<div class="main row">
    <div class="catego-title">
        <a href="<?php echo $base_url; ?>tin-xnk"><span>Tin XNK</span></a>
    </div>

    <section class="fck col-md-12">
        <h1><?php echo $aNewsDetails['title']; ?></h1>
        <div class="tool-bar">
            <span class="date">
                <?php
                //show date time Tieng Viet
                $str_search = array(
                    "Mon",
                    "Tue",
                    "Wed",
                    "Thu",
                    "Fri",
                    "Sat",
                    "Sun"
                );
                $str_replace = array(
                    "Th&#7913; hai",
                    "Th&#7913; ba",
                    "Th&#7913; t&#432;",
                    "Th&#7913; n&#259;m",
                    "Th&#7913; s&#225;u",
                    "Th&#7913; b&#7843;y",
                    "Ch&#7911; nh&#7853;t"
                );
                //$timenow = gmdate("D, d/m/Y | H:i", time() + 7 * 3600);
                $time = strtotime($aNewsDetails['display_date']);
                $timenow = date('D, d/m/Y | H:i', $time);
                $timenow = str_replace($str_search, $str_replace, $timenow);
                echo $timenow;
                ?>
            </span>
            <ul class="social-bar">
                <li>
                    <a target="_blank" class="wi-icon wi-icon-face" href="https://www.facebook.com/sharer.php?u=<?php echo $current_url; ?>" title="facebook"></a>
                </li>
                <li>
                    <a class="wi-icon wi-icon-tw" href="https://twitter.com/share" title="tw"></a>
                </li>
                <li>
                    <a target="_blank" class="wi-icon wi-icon-google" href="https://plus.google.com/share?url=<?php echo $current_url; ?>" title="google plus"></a>
                </li>
                <li>
                    <a target="_blank" class="wi-icon wi-icon-mail" href="mailto:?subject=Xem%20n%E1%BB%99i%20dung%20b%C3%A0i%20vi%E1%BA%BFt%20:<?php echo $current_url; ?>" title="mail"></a>
                </li>
            </ul>
        </div>
        <?php
        if ($aNewsDetails['source'] != 'Báo Hải Quan' && $aNewsDetails['source'] != 'Báo Công Thương') {
            echo "<p><strong>" . $aNewsDetails['short_desc'] . "</strong></p>";
        }
        ?>
    </section>

    <section class="fck col-md-12">
        <div class="fck">
            <p>
                <?php 
                $full_desc = preg_replace('#<p.*?>(.*?)</p>#i', '<p>\1</p>', $aNewsDetails['full_desc']);
                $full_desc = preg_replace('#<span.*?>(.*?)</span>#i', '<span>\1</span>', $full_desc);
                $full_desc = preg_replace('#<ol.*?>(.*?)</ol>#i', '<ol>\1</ol>', $full_desc);
                $full_desc = preg_replace('#<ul.*?>(.*?)</ul>#i', '<ul>\1</ul>', $full_desc);
                $full_desc = preg_replace('#<li.*?>(.*?)</li>#i', '<li>\1</li>', $full_desc);
                echo $full_desc;
                ?>
            </p>
        </div>
        <div class="hlight">
            <span class="author">
                <?php if ($aNewsDetails['source'] != NULL && $aNewsDetails['source'] != '') {
                echo 'Nguồn: ' . $aNewsDetails['source'];
                } ?>
            </span>
        </div>

        <div class="block-1">
            <h2>Tin nổi bật</h2>
            <ul class="list-new list-noborder">
                <?php
                $parent_cate_url = "";
                foreach ($aFeatureNews as $item):
                    //Nếu tin có parent_cate_url thì mới attach vào.
                    if ($item->parent_cate_url != "")
                        $parent_cate_url = $item->parent_cate_url . "/";
                    ?>
                    <li>
                        <a class="name" href="<?php echo $base_url . $parent_cate_url . $item->news_cate_url . "/" . $item->url . "-" . $item->news_id; ?>.html" title="<?php echo $item->title; ?>"><?php echo $item->title; ?></a>
                    </li>                
                    <?php
                    $parent_cate_url = "";
                endforeach;
                ?>
            </ul>
        </div>
        <!--
        <ul class="block-key">
            <li>Từ khóa</li>
            <li>
                <a href="#">Key 1</a>
            </li>
            <li>
                <a href="#">Key 2</a>
            </li>            
        </ul>
        -->
    </section>    
</div>

<div class="main row">
    <section class="content content-1 col-md-7 col-sm-7 col-xs-12">
        <div class="block-comment-1">
            <div id="s-comment" class="comment">
                <div class="fb-like" data-href="<?php echo $current_url; ?>" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>
                <div class="fb-comments" data-href="<?php echo $current_url; ?> "data-numposts="10" data-colorscheme="light"></div>                
            <!--<div class="block-comment">
                </div>-->
            </div>
        </div>
    </section>
    <aside class="sidebar col-md-5 col-sm-5 col-xs-12 ">
        <div class="block-1">
            <h2>Tin khác</h2>
            <?php
            /* Nếu muốn dùng tin có hình ảnh thì sử dụng đoạn code này*/
            /*            
            foreach ($aOtherNews as $item):
                //Nếu tin có parent_cate_url thì mới attach vào.
                if ($item->parent_cate_url != "")
                    $parent_cate_url = $item->parent_cate_url . "/";
                ?>
                <article>
                    <a class="thumbs img_165_93" href="<?php echo $base_url . $parent_cate_url . $item->news_cate_url . "/" . $item->url . "-" . $item->news_id; ?>.html" title="<?php echo $item->title; ?>">
                        <img src="<?php echo $img_url; ?>style/<?php echo $item->img_thumb; ?>" alt="<?php echo $item->title; ?>"> </a>
                    <h3>
                        <a href="<?php echo $base_url . $parent_cate_url . $item->news_cate_url . "/" . $item->url . "-" . $item->news_id; ?>.html" title="<?php echo $item->title; ?>"><?php echo $item->title; ?></a>
                    </h3>
                </article>            
                <?php
                $parent_cate_url = "";
            endforeach;
             */
            ?>
            <?php
            $i=1; 
            foreach ($aOtherNews as $item):
                //Nếu tin có parent_cate_url thì mới attach vào.
                if ($item->parent_cate_url != "")
                    $parent_cate_url = $item->parent_cate_url . "/";
                if ($i == 1){
            ?>
                    <ul class="list-new list-noborder">
                        <li>
                            <a href="<?php echo $base_url . $parent_cate_url . $item->news_cate_url . "/" . $item->url . "-" . $item->news_id; ?>.html"><?php echo $item->title; ?></a>
                        </li>                
                    </ul>            
            <?php
                }else{                   
            ?>
                    <ul class="list-new">
                        <li>
                            <a href="<?php echo $base_url . $parent_cate_url . $item->news_cate_url . "/" . $item->url . "-" . $item->news_id; ?>.html"><?php echo $item->title; ?></a>
                        </li>                
                    </ul>
            <?php
                }
                $i++;
                $parent_cate_url = "";
            endforeach;
            ?>            
        </div>
    </aside>
</div>